package com.alphathink.deliveryassist.util;

import android.app.Activity;

/****
 * 
 * @ClassName: DisplayUtil
 * @Description: TODO
 * @author alphathink xpg
 * @date 2015-4-28 上午12:25:26
 * 
 */
public class DisplayUtil {
	public static int dip2px(Activity activity, float dipValue) {
		final float scale = activity.getResources().getDisplayMetrics().density;
		return (int) (dipValue * scale + 0.5f);
	}

	public static int px2dip(Activity activity, float pxValue) {
		// 获取的是项目
		final float scale = activity.getResources().getDisplayMetrics().density;
		System.out.println(scale + "scale");
		return (int) (pxValue / scale + 0.5f);
	}
}
